<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <title>技能交换 - 社交平台</title>
  <!-- Bootstrap 5 CSS -->
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css">
  
  <style>
    /* 基础样式调整 */
    body {
      background-color: #f8f9fa;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      padding-bottom: 80px;
    }
    
    /* 顶部导航 */
    .navbar {
      box-shadow: 0 2px 8px rgba(0,0,0,0.08);
      z-index: 1050;
    }
    
    /* 筛选区域滚动优化 */
    .filter-scroll {
      overflow-x: auto;
      scrollbar-width: none;
    }
    .filter-scroll::-webkit-scrollbar {
      display: none;
    }
    
    /* 列表项样式    卡片悬停效果 */
    .skill-card {
      transition: transform 0.2s, box-shadow 0.2s;
    }
    .skill-card:hover {
      transform: translateY(-3px);
      box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    }
    
    /* 列表项分隔线 */
    .list-item {
      border-bottom: 1px solid #eee;
      padding: 12px 0;
    }
    .list-item:last-child {
      border-bottom: none;
    }
    
    /* 底部操作栏 */
    .bottom-nav {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      background-color: white;
      box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
      z-index: 1040;
    }
    
    /* 加载动画 */
    .loader {
      width: 20px;
      height: 20px;
      border: 2px solid #ddd;
      border-bottom-color: #3b82f6;
      border-radius: 50%;
      animation: spin 1s linear infinite;
    }
    @keyframes spin {
      to { transform: rotate(360deg); }
    }
  </style>
</head>
<body>
  <!-- 顶部导航栏 -->
  <nav class="navbar navbar-light bg-white fixed-top">
    <div class="container-fluid px-4">
      <h5 class="navbar-brand mb-0 fw-bold">技能交换</h5>
      <button class="btn btn-outline-primary btn-sm" type="button">
        <i class="fa fa-plus mr-1"></i>发布技能
      </button>
    </div>
  </nav>

  <!-- 主内容区 -->
  <div class="container-fluid pt-16 px-4" style="margin-top: 56px;">
    <!-- 搜索框 -->
    <div class="input-group mb-4">
      <span class="input-group-text bg-white border-end-0">
        <i class="fa fa-search text-secondary"></i>
      </span>
      <input type="text" class="form-control border-start-0" placeholder="搜索技能或用户..." aria-label="搜索">
      <button class="btn btn-outline-secondary d-none d-sm-flex" type="button">搜索</button>
    </div>
    
    <!-- 筛选条件栏 -->
    <div class="filter-scroll mb-4">
      <div class="d-flex gap-2 pb-2">
        <button class="btn btn-primary rounded-pill px-4">全部技能</button>
        <button class="btn btn-light rounded-pill px-4">编程语言</button>
        <button class="btn btn-light rounded-pill px-4">设计创意</button>
        <button class="btn btn-light rounded-pill px-4">运动健身</button>
        <button class="btn btn-light rounded-pill px-4">音乐艺术</button>
        <button class="btn btn-light rounded-pill px-4">语言学习</button>
        <button class="btn btn-light rounded-pill px-4">手工制作</button>
      </div>
    </div>
    
    <!-- 次级筛选栏 -->
    <div class="row mb-4">
      <div class="col-3">
        <select class="form-select form-select-sm">
          <option>距离最近</option>
          <option>最新发布</option>
          <option>人气最高</option>
        </select>
      </div>
      <div class="col-3">
        <select class="form-select form-select-sm">
          <option>全部距离</option>
          <option>1公里内</option>
          <option>5公里内</option>
          <option>10公里内</option>
        </select>
      </div>
      <div class="col-3">
        <select class="form-select form-select-sm">
          <option>全部性别</option>
          <option>男</option>
          <option>女</option>
        </select>
      </div>
      <div class="col-3 d-flex justify-content-end">
        <div class="btn-group btn-group-sm">
          <button id="cardViewBtn" class="btn btn-light active">
            <i class="fa fa-th-large"></i>
          </button>
          <button id="listViewBtn" class="btn btn-light">
            <i class="fa fa-list"></i>
          </button>
        </div>
      </div>
    </div>
    
    <!-- 卡片视图 (默认显示) -->
    <div id="cardView" class="row gap-3 mb-4">
      <!-- 卡片1 -->
      <div class="col-6">
        <div class="card skill-card h-100">
          <div class="position-relative">
            <img src="https://picsum.photos/300/200?random=1" class="card-img-top" alt="摄影技能">
            <span class="position-absolute top-2 right-2 bg-primary text-white text-xs px-2 py-1 rounded">摄影</span>
          </div>
          <div class="card-body p-3">
            <div class="d-flex align-items-center mb-2">
              <img src="https://picsum.photos/40/40?random=101" class="rounded-circle me-2" width="36" height="36">
              <div>
                <h6 class="card-title mb-0 fs-6">李明</h6>
                <p class="text-secondary text-xs mb-0">2公里 · 2小时前</p>
              </div>
            </div>
            <p class="card-text text-sm mb-2">用单反5年，可教基础摄影和后期，想学吉他</p>
            <div class="d-flex justify-content-between align-items-center">
              <span class="text-xs text-secondary"><i class="fa fa-eye mr-1"></i>128</span>
              <button class="btn btn-primary btn-sm rounded-pill px-3">联系</button>
            </div>
          </div>
        </div>
      </div>
      
      <!-- 卡片2 -->
      <div class="col-6">
        <div class="card skill-card h-100">
          <div class="position-relative">
            <img src="https://picsum.photos/300/200?random=2" class="card-img-top" alt="钢琴技能">
            <span class="position-absolute top-2 right-2 bg-primary text-white text-xs px-2 py-1 rounded">音乐</span>
          </div>
          <div class="card-body p-3">
            <div class="d-flex align-items-center mb-2">
              <img src="https://picsum.photos/40/40?random=102" class="rounded-circle me-2" width="36" height="36">
              <div>
                <h6 class="card-title mb-0 fs-6">王芳</h6>
                <p class="text-secondary text-xs mb-0">5公里 · 昨天</p>
              </div>
            </div>
            <p class="card-text text-sm mb-2">钢琴十级，可教初学者，想学英语口语</p>
            <div class="d-flex justify-content-between align-items-center">
              <span class="text-xs text-secondary"><i class="fa fa-eye mr-1"></i>95</span>
              <button class="btn btn-primary btn-sm rounded-pill px-3">联系</button>
            </div>
          </div>
        </div>
      </div>
      
      <!-- 卡片3 -->
      <div class="col-6">
        <div class="card skill-card h-100">
          <div class="position-relative">
            <img src="https://picsum.photos/300/200?random=3" class="card-img-top" alt="编程技能">
            <span class="position-absolute top-2 right-2 bg-primary text-white text-xs px-2 py-1 rounded">编程</span>
          </div>
          <div class="card-body p-3">
            <div class="d-flex align-items-center mb-2">
              <img src="https://picsum.photos/40/40?random=103" class="rounded-circle me-2" width="36" height="36">
              <div>
                <h6 class="card-title mb-0 fs-6">张伟</h6>
                <p class="text-secondary text-xs mb-0">1公里 · 3天前</p>
              </div>
            </div>
            <p class="card-text text-sm mb-2">前端开发工程师，可教JS/HTML，想学架子鼓</p>
            <div class="d-flex justify-content-between align-items-center">
              <span class="text-xs text-secondary"><i class="fa fa-eye mr-1"></i>210</span>
              <button class="btn btn-primary btn-sm rounded-pill px-3">联系</button>
            </div>
          </div>
        </div>
      </div>
      
      <!-- 卡片4 -->
      <div class="col-6">
        <div class="card skill-card h-100">
          <div class="position-relative">
            <img src="https://picsum.photos/300/200?random=4" class="card-img-top" alt="烹饪技能">
            <span class="position-absolute top-2 right-2 bg-primary text-white text-xs px-2 py-1 rounded">美食</span>
          </div>
          <div class="card-body p-3">
            <div class="d-flex align-items-center mb-2">
              <img src="https://picsum.photos/40/40?random=104" class="rounded-circle me-2" width="36" height="36">
              <div>
                <h6 class="card-title mb-0 fs-6">赵丽</h6>
                <p class="text-secondary text-xs mb-0">8公里 · 1周前</p>
              </div>
            </div>
            <p class="card-text text-sm mb-2">家常菜烹饪，可教川菜，想学街舞</p>
            <div class="d-flex justify-content-between align-items-center">
              <span class="text-xs text-secondary"><i class="fa fa-eye mr-1"></i>156</span>
              <button class="btn btn-primary btn-sm rounded-pill px-3">联系</button>
            </div>
          </div>
        </div>
      </div>
    </div>
    
    <!-- 列表视图 (默认隐藏) -->
    <div id="listView" class="d-none">
      <!-- 列表项1 -->
      <div class="list-item bg-white rounded-3 p-3">
        <div class="d-flex">
          <img src="https://picsum.photos/60/60?random=101" class="rounded-circle me-3" width="60" height="60">
          <div class="flex-grow-1">
            <div class="d-flex justify-content-between">
              <h6 class="fw-bold">李明</h6>
              <span class="badge bg-primary">摄影</span>
            </div>
            <p class="text-sm text-secondary mb-1">用单反5年，可教基础摄影和后期，想学吉他</p>
            <div class="d-flex justify-content-between align-items-center">
              <span class="text-xs text-secondary">2公里 · 2小时前</span>
              <button class="btn btn-primary btn-sm rounded-pill px-3">联系</button>
            </div>
          </div>
        </div>
      </div>
      
      <!-- 列表项2 -->
      <div class="list-item bg-white rounded-3 p-3">
        <div class="d-flex">
          <img src="https://picsum.photos/60/60?random=102" class="rounded-circle me-3" width="60" height="60">
          <div class="flex-grow-1">
            <div class="d-flex justify-content-between">
              <h6 class="fw-bold">王芳</h6>
              <span class="badge bg-primary">音乐</span>
            </div>
            <p class="text-sm text-secondary mb-1">钢琴十级，可教初学者，想学英语口语</p>
            <div class="d-flex justify-content-between align-items-center">
              <span class="text-xs text-secondary">5公里 · 昨天</span>
              <button class="btn btn-primary btn-sm rounded-pill px-3">联系</button>
            </div>
          </div>
        </div>
      </div>
      
      <!-- 列表项3 -->
      <div class="list-item bg-white rounded-3 p-3">
        <div class="d-flex">
          <img src="https://picsum.photos/60/60?random=103" class="rounded-circle me-3" width="60" height="60">
          <div class="flex-grow-1">
            <div class="d-flex justify-content-between">
              <h6 class="fw-bold">张伟</h6>
              <span class="badge bg-primary">编程</span>
            </div>
            <p class="text-sm text-secondary mb-1">前端开发工程师，可教JS/HTML，想学架子鼓</p>
            <div class="d-flex justify-content-between align-items-center">
              <span class="text-xs text-secondary">1公里 · 3天前</span>
              <button class="btn btn-primary btn-sm rounded-pill px-3">联系</button>
            </div>
          </div>
        </div>
      </div>
      
      <!-- 列表项4 -->
      <div class="list-item bg-white rounded-3 p-3">
        <div class="d-flex">
          <img src="https://picsum.photos/60/60?random=104" class="rounded-circle me-3" width="60" height="60">
          <div class="flex-grow-1">
            <div class="d-flex justify-content-between">
              <h6 class="fw-bold">赵丽</h6>
              <span class="badge bg-primary">美食</span>
            </div>
            <p class="text-sm text-secondary mb-1">家常菜烹饪，可教川菜，想学街舞</p>
            <div class="d-flex justify-content-between align-items-center">
              <span class="text-xs text-secondary">8公里 · 1周前</span>
              <button class="btn btn-primary btn-sm rounded-pill px-3">联系</button>
            </div>
          </div>
        </div>
      </div>
    </div>
    
    <!-- 加载更多 -->
    <div class="text-center py-4">
      <button class="btn btn-outline-secondary rounded-pill px-5">
        <span class="loader me-2"></span>加载更多
      </button>
    </div>
  </div>
  
  <!-- 底部导航 -->
  <div class="bottom-nav">
    <div class="container-fluid">
      <div class="row text-center py-3">
        <div class="col-3">
          <a href="#" class="text-primary d-block">
            <i class="fa fa-home fs-5 mb-1"></i>
            <span class="d-block text-xs">首页</span>
          </a>
        </div>
        <div class="col-3">
          <a href="#" class="text-secondary d-block">
            <i class="fa fa-compass fs-5 mb-1"></i>
            <span class="d-block text-xs">发现</span>
          </a>
        </div>
        <div class="col-3">
          <a href="#" class="text-secondary d-block">
            <i class="fa fa-bell fs-5 mb-1"></i>
            <span class="d-block text-xs">通知</span>
          </a>
        </div>
        <div class="col-3">
          <a href="#" class="text-secondary d-block">
            <i class="fa fa-user fs-5 mb-1"></i>
            <span class="d-block text-xs">我的</span>
          </a>
        </div>
      </div>
    </div>
  </div>

  <!-- Bootstrap JS -->
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
  
  <script>
    // 视图切换功能
    const cardViewBtn = document.getElementById('cardViewBtn');
    const listViewBtn = document.getElementById('listViewBtn');
    const cardView = document.getElementById('cardView');
    const listView = document.getElementById('listView');
    
    cardViewBtn.addEventListener('click', () => {
      cardView.classList.remove('d-none');
      listView.classList.add('d-none');
      cardViewBtn.classList.add('active');
      listViewBtn.classList.remove('active');
    });
    
    listViewBtn.addEventListener('click', () => {
      listView.classList.remove('d-none');
      cardView.classList.add('d-none');
      listViewBtn.classList.add('active');
      cardViewBtn.classList.remove('active');
    });
    
    // 技能类型筛选
    const filterButtons = document.querySelectorAll('.filter-scroll .btn');
    filterButtons.forEach(button => {
      button.addEventListener('click', () => {
        // 移除所有按钮的活跃状态
        filterButtons.forEach(btn => btn.classList.remove('btn-primary'));
        filterButtons.forEach(btn => btn.classList.add('btn-light'));
        
        // 设置当前按钮为活跃状态
        button.classList.remove('btn-light');
        button.classList.add('btn-primary');
        
        // 这里可以添加实际筛选逻辑
      });
    });
  </script>
</body>
</html>
